<template>
  <div class="evaluation-result-wrapper">
    <left-menu></left-menu>
    <div class="evaluation-result-content" ref="evaluationResultWrapper">
      <div v-if="showResult">
        <result-panel :cur-ccw="ccwEvaData" :cur-cth="cthEvaData" :cur-escf="escfEvaData"></result-panel>
      </div>
      <div style="padding: 20px;"  v-if="!showResult">
        您还未查询车辆信息
      </div>
    </div>
  </div>
</template>

<script>
import resultPanel from './../../components/qixiubao/resultPanel/resultPanel.vue'
import leftMenu from './../../components/qixiubao/leftMenu/leftMenu.vue'
import { Loading, Message } from 'element-ui'
export default {
  components: {
    resultPanel,
    leftMenu
  },
  data() {
    return {
      dispatch: this.$store.dispatch, // 用于vuex值得动态设置
      getter: this.$store.getters,
      showResult: false,
      ccwEvaData: {error: true},
      cthEvaData: {error: true},
      escfEvaData: {error: true}
    }
  },
  methods: {
    getLoading() {
      return Loading.service({
        target: this.$refs.evaluationResultWrapper,
        fullscreen: false,
        text: "拼命加载中~"
      })
    }
  },
  mounted() {
    var _self = this
    _self.ccwEvaData = _self.getter.CCWEvaluteRsult
    _self.cthEvaData = _self.getter.CTHEvaluteRsult
    _self.escfEvaData =  _self.getter.ESCFEvaluteRsult
    //if (Object.getOwnPropertyNames(_self.ccwEvaData).length > 0 && Object.getOwnPropertyNames(_self.ccwEvaData).length > 0 && Object.getOwnPropertyNames(_self.ccwEvaData).length > 0) {
    if (_self.ccwEvaData.error && _self.cthEvaData.error && _self.escfEvaData.error) {
      _self.showResult = false
    } else {
      _self.showResult = true
    }
  }
}
</script>

<style lang="less">
  @import './evaluationResult.less';
</style>
